#include<stdio.h>
#include<windows.h>
#include<conio.h>
int main()
{
    int i,j,x=5,y=5;
    char input;
    int isfire = 0;
    int killed = 0;
    int nx=5;
    int vv=1;
    int score = 0;

    while(1)
    {
        system("cls");

        for(i=1;i<=nx;i++)
            printf(" ");
        printf("+");
        for(i=1;i<=15-nx;i++)
            printf(" ");
        printf("score = %3d\n",score);



        if(isfire==0)
        {
            for(i=1;i<=y;i++)
                printf("\n");
        }
        else
        {
            for(i=1;i<=y;i++)
            {
                for(j=1;j<=x+2;j++)
                    printf(" ");
                printf("|\n");
            }

            isfire=0;
            if(x+2==nx)
            {
                nx+=vv;
                if(nx==1||nx==10)
                    vv=-vv;
                score++;
            }

        }

        for(j=1;j<=x;j++)
            printf(" ");
        printf("  *  \n");
        for(j=1;j<=x;j++)
            printf(" ");
        printf("*****\n");
        for(j=1;j<=x;j++)
            printf(" ");
        printf(" * * \n");


        input=getch();

        if(input=='w')
            y--;
        if(input=='s')
            y++;
        if(input=='a')
            x--;
        if(input=='d')
            x++;

        if(input==' ')
            isfire=1;


    }


    return 0;
} 0;
}